package com.chb.javabasic.Controller;

import java.util.*;

public class CollectionController {
    public static void main(String[] args) {
        // collecion集合
        System.out.println("----------ArrayList----------");
        Collection collection = new ArrayList();
        collection.add(1);
        collection.add(2);
        collection.add(3);
        for (Object o : collection) {
            System.out.println(o);
        }

        System.out.println("----------HashSet----------");
        Collection collection1 = new HashSet<>();
        collection1.add(1);
        collection1.add(1);
        collection1.add(2);
        for (Object o : collection1) {
            System.out.println(o);
        }

        System.out.println("----------LinkedList----------");

        Collection collection2 = new LinkedList();
        collection2.add(1);
        collection2.add(1);
        collection2.add(1);
        for (Object o : collection2) {
            System.out.println(o);
        }
    }
}
